package gestion.camping.dto;

import gestion.camping.utils.DateFormatUtils;

import java.util.Date;

public class Reservation {
	
	private long id;
	private Personne client;
	private Emplacement emplacement;
	private StatutReservation statut;
	private Carte carte;
	private TypeLocation typeLocation;
	private Badge badge;
	private Date dateDebut;
	private Date dateFin;
	private boolean ARRHE;
	private boolean FraisResa;
	private double montant;
	
	public Reservation(){
		client = new Personne();
		emplacement = new Emplacement();
		statut = new StatutReservation();
		carte = new Carte();
		typeLocation = new TypeLocation();
		badge = new Badge();
	}

	public Reservation(long id, Personne client, Emplacement emplacement,
			StatutReservation statut, Carte carte, TypeLocation typeLocation,
			Badge badge, Date dateDebut, Date dateFin, boolean ARRHE,
			boolean FraisResa, double montant) {
		super();
		this.id = id;
		this.client = client;
		this.emplacement = emplacement;
		this.statut = statut;
		this.carte = carte;
		this.typeLocation = typeLocation;
		this.badge = badge;
		this.dateDebut = dateDebut;
		this.dateFin = dateFin;
		this.ARRHE = ARRHE;
		this.FraisResa = FraisResa;
		this.montant = montant;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public Personne getClient() {
		return client;
	}

	public void setClient(Personne client) {
		this.client = client;
	}

	public Emplacement getEmplacement() {
		return emplacement;
	}

	public void setEmplacement(Emplacement emplacement) {
		this.emplacement = emplacement;
	}

	public StatutReservation getStatut() {
		return statut;
	}

	public void setStatut(StatutReservation statut) {
		this.statut = statut;
	}

	public Carte getCarte() {
		return carte;
	}

	public void setCarte(Carte carte) {
		this.carte = carte;
	}

	public TypeLocation getTypeLocation() {
		return typeLocation;
	}

	public void setTypeLocation(TypeLocation typeLocation) {
		this.typeLocation = typeLocation;
	}

	public Badge getBadge() {
		return badge;
	}

	public void setBadge(Badge badge) {
		this.badge = badge;
	}

	public Date getDateDebut() {
		return dateDebut;
	}

	public void setDateDebut(Date dateDebut) {
		this.dateDebut = dateDebut;
	}

	public Date getDateFin() {
		return dateFin;
	}

	public void setDateFin(Date dateFin) {
		this.dateFin = dateFin;
	}

	public double getMontant() {
		return montant;
	}

	public void setMontant(double montant) {
		this.montant = montant;
	}

	@Override
	public String toString() {
		return "Reservation [id=" + id + ", client=" + client.toString()
				+ ", emplacement=" + emplacement.toString() + ", statut=" + statut.toString()
				+ ", carte=" + carte.toString() + ", typeLocation=" + typeLocation.toString()
				+ ", badge=" + badge.toString() + ", dateDebut=" + DateFormatUtils.formatDate(dateDebut)
				+ ", dateFin=" +  DateFormatUtils.formatDate(dateFin) + ", ARRHE=" + ARRHE
				+ ", FraisResa=" + FraisResa + ", montant="
				+ montant + "]";
	}

	public boolean getARRHE() {
		return ARRHE;
	}

	public void setARRHE(boolean aRRHE) {
		ARRHE = aRRHE;
	}

	public boolean getFraisResa() {
		return FraisResa;
	}

	public void setFraisResa(boolean fraisResa) {
		FraisResa = fraisResa;
	}

	public String getDateDebutString() {
		if(dateDebut != null){
			return DateFormatUtils.formatDate(dateDebut);
		}else{
			return null;
		}
	}

	public String getDateFinString() {
		if(dateFin != null){
			return DateFormatUtils.formatDate(dateFin);
		}else{
			return null;
		}
	}
}
